package com.hl.toolkit.server.tycoin.news.slaverepository;

import com.tycoin.common.repository.AbstractRepository;
import com.tycoin.news.slaveentity.TycoinNews;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository
@CacheConfig(cacheNames = "com.tycoin.account.slaverepository.tycoinNewsRepository")
 public interface TycoinNewsRepository extends AbstractRepository<TycoinNews, Long> {
	
	@Query(" select t from TycoinNews t where t.newsType=:newsType and t.status=1  order by t.sort ASC ")
 	Page <TycoinNews> queryTycoinNewsRepositoryByStatusAndNewsType(@Param("newsType") int newsType, Pageable pageable);
 
}
